package com.agstar.designpatten.behavioral.memento;

/**
 * @author agstar
 * @date 2020/4/24 17:10
 */
public class Test {
    public static void main(String[] args) {
        ArticleMementoManager articleMementoManager = new ArticleMementoManager();
        Article article = new Article("design pattern A", "content A", "image1");
        ArticleMemento articleMemento = article.saveToMemento();
        articleMementoManager.setMemento(articleMemento);
        System.out.println("title:" + article.getTitle() + " content:" + article.getContent() + " iamges:" + article.getImgs());
        System.out.println("complent info:" + article);

        System.out.println("Start modifying article");
        article.setTitle(" design pattern B");
        article.setContent("content B");
        article.setImgs("picture B");
        System.out.println("article modify end");
        System.out.println("complent info:"+article);

    }
}
